package com.lhl.fw.core.base;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @className: com.lhl.fw.core.base.PageDTO
 * @description: 分页泛型对象
 * @author: king
 * @date: 2020-12-01
 **/
@Api(tags = "分页泛型对象", produces = "PageDTO")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageDTO<T> {
    @ApiModelProperty(value = "总记录数")
    private long total;
    @ApiModelProperty(value = "开始行数")
    private long limit;
    @ApiModelProperty(value = "每页行数")
    private long offset;
    @ApiModelProperty(value = "集合数据")
    private List<T> content;

    public PageDTO(long total, List<T> content) {
        this.total = total;
        this.content = content;
    }
}
